package com.linsen.core.common.context;

import com.alibaba.ttl.TransmittableThreadLocal;

/**
 * @author zhaoyong
 * @date 2023/3/11
 * 令牌上下文
 */
public final class TokenContextHolder {
    private final static TransmittableThreadLocal<String> TOKEN_CONTEXT = new TransmittableThreadLocal<>();

    public static void setToken(String token) {
        TOKEN_CONTEXT.set(token);
    }

    public static String getToken() {
        return TOKEN_CONTEXT.get();
    }

    public static void removeToken() {
        TOKEN_CONTEXT.remove();
    }
}
